﻿using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Service.Auth.Domain.AggregatesModel;
using Service.Core.Filters;
using Service.Core.Identity;
using Service.Core.Identity.Model;
using Service.Core.Repository;
using Service.Framework;
using Service.Framework.ApplicationEventBus;
using Service.Framework.Packet;
using Service.Auth.Api.Application.Command;
using Service.Auth.Model.Model.RequestDto.System;

namespace Service.Auth.Api.Controller
{
    /// <summary>
    /// 用户管理
    /// </summary>
    public class TestController(
        IRepository<User, long> repository,
        IMediator mediator, IApplicationEventBus applicationEventBus,
        IConfiguration _configuration,
        AppSettings<IdsServiceConfigure> appSettings, ClientService clientService)
        : BaseController(mediator)
    {


        [HttpPost]
        [AllowAnonymous]
        [ApiCheckModel()]
        public virtual async Task<Boolean?> test([FromBody] CreateSystemCommand command)
        {
            return true;
        }





        /// <summary>
        /// testdddd
        /// </summary>
        /// <param name="formFile"></param>
        /// <returns></returns>
        [HttpPost]
        //[Authorize]
        public async Task<R> testdddd(IFormFile formFile)
        {

            return R.OkData("");
            //var dddssss = await clientService.GetAccessToken();
            //var dd = await feginClientService.QuerySystemByClientId("zkhz", "dddssss");
            //return R.OkData(_configuration["Authority"] + "----" + appSettings.Instance.IdsConfig.Authority + $"test:{JsonConvert.SerializeObject(dd)}");
        }
    }
}